$(function() {
	
});

showPaperUseNum = function(paperType) {
	var staffId = getLoginedUser()? getLoginedUser().staffId: '';
	var staffName = getLoginedUser()? getLoginedUser().staffName: '';

	find_basic_by_json(path+'/paper/getUserPaper', {staffId: staffId, paperType: paperType},
		onSuccess=function(response) {
			$('#paperNum').text(response.data[0].useNum);

			if(view && view.data) {
				view.data.batchNum = response.data[0].batchNum;
				view.data.startNum = response.data[0].startNum;
				view.data.endNum = response.data[0].endNum;
				// view.data.amount = response.data[0].pay;
			}
		},
		onEmpty=function(response) {
			alert('请先设置此单据的号码');
		}
	);
}

showPaperUseNumByRelation = function(relationId,paperType) {
    var staffId = getLoginedUser()? getLoginedUser().staffId: '';
    var staffName = getLoginedUser()? getLoginedUser().staffName: '';

    find_basic_by_json(path+'/paperRecord/getUserPaperByRelationId', {relationId: relationId, paperType: paperType},
        onSuccess=function(response) {
            $('#paperNum').text(response.data[0].paperNum);

            if(view && view.data) {
                view.data.batchNum = response.data[0].batchNum;
                view.data.startNum = response.data[0].startNum;
                view.data.endNum = response.data[0].endNum;
                // view.data.amount = response.data[0].pay;
            }
        },
        onEmpty=function(response) {
            alert('获取单据的号码失败');
        }
    );
}